package com.coocaa.launcher.framework.manager.configdata;

import java.util.List;

import android.os.Looper;

import com.coocaa.launcher.framework.manager.configdata.data.LauncherAppItemTableData;

public class ConfigManager {
    private static ConfigManager instance = null;

    public static ConfigManager getInstance() {
        if (instance == null) {
            instance = new ConfigManager();
        }
        return instance;
    }

    private ConfigManager() {
    }

    //DBManager操作   -------------------------------------------------------------------------------------------


    //获取  插入  桌面item数据
    public void insertLauncherAppItemData(String dataid, String type, String pattern, String json) {
        DBManager.getInstance().getLauncherAppItemDataController().insertLauncherAppItemTableData(dataid, type, pattern, json);
    }

    public List<LauncherAppItemTableData> getLauncherAppIntemDatas() {
        return DBManager.getInstance().getLauncherAppItemDataController().getLauncherAppItemTableDatas();
    }

    public List<LauncherAppItemTableData> getLauncherAppIntemDatasSelect(String dataid, String type, String pattern) {
        return DBManager.getInstance().getLauncherAppItemDataController().getLauncherAppItemTableDatasSelect(dataid, type, pattern);
    }

    public void updateLauncherAppIntemDatas(String dataid, String type, String pattern, String json) {
        DBManager.getInstance().getLauncherAppItemDataController().updateLauncherAppItemTableData(dataid, type, pattern, json);
    }

    public void deleteLauncherAppIntemDatas(String dataid) {
        DBManager.getInstance().getLauncherAppItemDataController().deleteLauncherAppItemTableData(dataid);
    }

    //appConfig数据处理


    //SharePreference操作 -------------------------------------------------------------------------------------------


    //WebDataManager操作    -------------------------------------------------------------------------------------------


    public void checkThread() {
        Looper mLooper = Looper.myLooper();
        if (mLooper == Looper.getMainLooper())
            throw new RuntimeException("you can not call this in main thread!!!!!!");
    }
}
